/**
 * 
 */
Ext.define('appfe.stockor.statist.chart.KLine', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.stockor.statist.chart.KLine',
    xtype: 'kline-panel',
    requires: [
        'appfe.stockor.statist.chart.KLineModel',
        'appfe.stockor.statist.chart.KLineController'
    ],
    controller: 'stockor.statist.chart.KLine',
    viewModel: 'stockor.statist.chart.KLine',
    layout: {
        type: 'vbox',
        pack: 'start',
        align: 'stretch'
    },
    style: {
        borderWidth: 0
    },
    items: [
        {
            flex: 1,
            xtype: 'container',
            reference: 'klineChartPanel',
            border: false,
            margin: '1 1 1 1'
        }
    ],
    dockedItems: [
        {
            xtype: 'toolbar',
            dock: 'top',
            ui: 'footer',
            // style: {
            //     backgroundColor: '#bedbeb'
            // },
            padding: '10 10 10 10',
            defaults: {
                margin: '0 5 0 5'
                //minWidth: 80
            },
            items: [
                {
                    xtype: 'textfield',
                    fieldLabel: '简码',
                    labelAlign: 'right',
                    labelWidth: 30,
                    anchor: '100%',
                    width: 140,
                    reference: 'slimsymbolQC',
                    emptyText: '多个值由逗号分隔',
                    bind: '{slimsymbol}'
                }, {
                    xtype: 'displayfield',
                    fieldLabel: '股票名称',
                    labelAlign: 'right',
                    labelWidth: 60,
                    anchor: '100%',
                    width: 160,
                    height: 30,
                    bind: '{stkname}'
                }, {
                    xtype: 'combo',
                    fieldLabel: '级别',
                    labelAlign: 'right',
                    labelWidth: 30,
                    anchor: '100%',
                    width: 140,
                    reference: 'gradeQC',
                    editable: false,
                    bind: {
                        store: '{klineGradeStore}',
                        value: '{grade}'
                    },
                    multiSelect: true,
                    queryMode: 'local',
                    valueField: 'code',
                    displayField: 'text'
                }, {
                    xtype: 'combo',
                    fieldLabel: '类型',
                    labelAlign: 'right',
                    labelWidth: 30,
                    anchor: '100%',
                    width: 140,
                    reference: 'klinetypeQC',
                    editable: false,
                    bind: {
                        store: '{klineTypeStore}',
                        value: '{klinetype}'
                    },
                    listConfig: { itemTpl: ['<div data-qtip="{tips}">{text}</div>'] },
                    multiSelect: false,
                    queryMode: 'local',
                    valueField: 'code',
                    displayField: 'text'
                }, {
                    xtype: 'checkboxfield',
                    boxLabel: '显示MACD',
                    bind: {
                        value: '{isMacdDisplayed}'
                    },
                    reference: 'isMacdDisplayedQC',
                    anchor: '100%'
                }, {
                    xtype: 'checkboxfield',
                    boxLabel: '显示包含标准K线',
                    bind: {
                        value: '{keepIgnoredStdKline}',
                        disabled:'{keepIgnoredStdKlineDisabled}'
                    },
                    reference: 'keepIgnoredStdKlineQC',
                    anchor: '100%'
                }, {
                    xtype: 'tbspacer',
                    width: 50
                }, { //查询按钮
                    xtype: 'button',
                    text: '查询',
                    iconCls: 'x-fa fa-search',
                    handler: 'searchFn'
                }
            ]
        }
    ],
    listeners: {
        drawAllKlineCharts: 'drawAllKlineCharts',
        boxready: 'onBoxReady',
        resize: 'onResize'
    }
});